package worker_tools

import (
	"GraduationProject/public/db"
	"GraduationProject/public/models"
	"fmt"
)

func IsStopped(workerID string) bool {
	result, err := db.Redis.HGet(models.WorkerStatusKey, workerID).Result()
	if err != nil {
		fmt.Printf("workerID: %s\t IsStopped error:%s\n", workerID, err.Error())
		return true
	}
	if result != "0" {
		return true
	}
	fmt.Printf("IsStopped false\n")
	return false
}
